import 'package:flutter/material.dart';


import 'my_popup_child.dart';
import 'my_popup_route.dart';

class MyPopup{
  static pop(BuildContext context){
     MyPopupRoute.pop(context);
  }

  static show(
      BuildContext context,
      MyPopupChild child,
      {
        Offset offsetLT = const Offset(0, 0),
        Offset offsetRB = const Offset(0, 0),
        bool cancelable = true,
        bool outsideTouchCancelable = true,
        bool dartEnable = true,
        Duration duration = const Duration(milliseconds: 300),
        List<RRect>? highlights,
        }
      ){

    Navigator.of(context).push(MyPopupRoute(
      child: child,
      offsetLT: offsetLT,
      offsetRB: offsetRB,
      cancelable: cancelable,
      outsideTouchCancelable: outsideTouchCancelable,
      darkEnable: dartEnable,
      duration: duration,
      highlights: highlights,
    ));
  }

  ///Set popup highlight positions
  static setHighlights(BuildContext context, List<RRect> highlights) {
     MyPopupRoute.setHighlights(context, highlights);
  }
}